/*
 * @description: 
 * @param: 
 * @return: 
 */
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FollowStageVO, FollowStageForm, FollowStageQuery } from '@/api/goods/followStage/types';

/**
 * 查询跟单阶段列表
 * @param query
 * @returns {*}
 */

export const listFollowStage = (query?: FollowStageQuery): AxiosPromise<FollowStageVO[]> => {
  return request({
    url: '/order/followStage/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询跟单阶段详细
 * @param id
 */
export const getFollowStage = (id: string | number): AxiosPromise<FollowStageVO> => {
  return request({
    url: '/order/followStage/' + id,
    method: 'get'
  });
};
/**
 * 通过跟单类型id查询跟单阶段
 * @param id
 */
export const listByTypeId = (id: string | number): AxiosPromise<FollowStageVO> => {
  return request({
    url: '/order/followStage/listByTypeId/' + id,
    method: 'get'
  });
};
/**
* 通过跟单类型id查询跟单阶段
* @param id
*/
export const allListByType = (id: string | number): AxiosPromise<FollowStageVO> => {
  return request({
    url: '/order/followStage/allListByType',
    method: 'get'
  });
};
/**
 * 新增跟单阶段
 * @param data
 */
export const addFollowStage = (data: FollowStageForm) => {
  return request({
    url: '/order/followStage',
    method: 'post',
    data: data
  });
};

/**
 * 修改跟单阶段
 * @param data
 */
export const updateFollowStage = (data: FollowStageForm) => {
  return request({
    url: '/order/followStage',
    method: 'put',
    data: data
  });
};

/**
 * 删除跟单阶段
 * @param id
 */
export const delFollowStage = (id: string | number | Array<string | number>) => {
  return request({
    url: '/order/followStage/' + id,
    method: 'delete'
  });
};

export default {
  list: listFollowStage,
  get: getFollowStage,
  add: addFollowStage,
  update: updateFollowStage,
  del: delFollowStage,
}